package com.wsh.archive.service.command;

import org.apache.commons.chain.Command;
import org.apache.commons.chain.Context;

import com.wsh.archive.service.business.ArchiveService;
import com.wsh.archive.service.constants.ArchiveConstants;
import com.wsh.archive.service.facade.BeanFacade;
import com.wsh.archive.vo.ArchiveVO;

/**
 * 
 * @author washingtonw
 *
 */
public class ExportarArquivoCMD implements Command {	
	
	@Override
	public boolean execute(Context ctx) throws Exception {
				
		ArchiveVO vo = (ArchiveVO) ctx.get(ArchiveConstants.ARCHIVE_VO);
		ArchiveService service = BeanFacade.getInstance().getBean(vo.getTypeArchiveKey());
		service.export(vo);
		
		return false;
	}

}
